using System;
using System.Collections.Generic;
using System.Text;
using WindowsLive.Writer.Api;

namespace InsertVideo
{
    public class VideoSettings
    {
        # region Declarations
        private IProperties _properties;
        private const string DEFAULTWIDTH1 = "DEFAULTWIDTH";
        private const string DEFAULTENABLED = "DEFAULTENABLED";
        private const string DEFAULTOPTION = "DEFAULTOPTION";
        private const string DEFAULTOPENNEW = "DEFAULTOPENINNEWWINDOW";
        private const string DEFAULTTRANSPARENCY = "DEFAULTTRANSPARENCY";
        private const string DEFAULTTITLEENABLED = "DEFAULTTITLEENABLED";
        private const string DEFAULTAUTOPLAYOPTION = "DEFAULTAUTOPLAY";
        private const string PROPERTYWIDTH = "WIDTH";
        private const string PROPERTYOPTION = "OPTION";
        private const string PROPERTYPREVIEW = "PREVIEW";
        private const string PROPERTYPROVIDER = "PROVIDER";
        private const string PROPERTYID = "VIDEOID";
        private const string PROPERTYEMBED = "EMBED";
        private const string PROPERTYLINK = "LINK";
        private const string PROPERTYTITLE = "TITLE";
        private const string PROPERTYRATIO = "RATIO";
        private const string PROPERTYTITLEENABLED = "TITLEENABLED";
        private const string PROPERTYTRANSPARENCY = "TRANSPARENCY";
        private const string PROPERTYOPEN = "OPENINNEWWINDOW";
        private const string PROPERTYAUTOPLAY = "AUTOPLAY";
        private const string PROPERTYAUTOPLAYVALUE = "AUTOPLAYVALUE";
        private const string PROPERTYALLOWAUTOPLAY = "ALLOWAUTOPLAY";
        private const string FINALCODE = "FINALCODE";
        private const string MARGINSTATE = "MARGINSTATE";
        private const string YOUTUBEREL = "YOUTUBEREL";
        private const string _1 = "NUM1";
        private const string _2 = "NUM2";
        private const string _3 = "NUM3";
        private const string _4 = "NUM4";
        #endregion

        public VideoSettings(IProperties properties)
        {
            _properties = properties;
        }

        public int DefaultWidth
        {
            get { return _properties.GetInt(DEFAULTWIDTH1, 400); }
            set { _properties.SetInt(DEFAULTWIDTH1, value); }
        }

        public bool IsEnabled
        {
            get { return _properties.GetBoolean(DEFAULTENABLED, false); }
            set { _properties.SetBoolean(DEFAULTENABLED, value); }
        }

        public int DefaultOption
        {
            get { return _properties.GetInt(DEFAULTOPTION, 0); }
            set { _properties.SetInt(DEFAULTOPTION, value); }
        }

        public bool DefaultOpen
        {
            get { return _properties.GetBoolean(DEFAULTOPENNEW, false); }
            set { _properties.SetBoolean(DEFAULTOPENNEW, value); }
        }

        public bool DefaultTransparancySetting
        {
            get { return _properties.GetBoolean(DEFAULTTRANSPARENCY, true); }
            set { _properties.SetBoolean(DEFAULTTRANSPARENCY, value); }
        }

        public bool DefaultTitleIsEnabled
        {
            get { return _properties.GetBoolean(DEFAULTTITLEENABLED, false); }
            set { _properties.SetBoolean(DEFAULTTITLEENABLED, value); }
        }

        public bool DefaultAutoplay
        {
            get { return _properties.GetBoolean(DEFAULTAUTOPLAYOPTION, false); }
            set { _properties.SetBoolean(DEFAULTAUTOPLAYOPTION, value); }
        }

        public bool Preview
        {
            get { return _properties.GetBoolean(PROPERTYPREVIEW, true); }
            set { _properties.SetBoolean(PROPERTYPREVIEW, value); }
        }

        public string Provider
        {
            get { return _properties.GetString(PROPERTYPROVIDER, "google"); }
            set { _properties.SetString(PROPERTYPROVIDER, value); }
        }

        public string Id
        {
            get { return _properties.GetString(PROPERTYID, ""); }
            set { _properties.SetString(PROPERTYID, value); }
        }

        public int Width
        {
            get { return _properties.GetInt(PROPERTYWIDTH, 400); }
            set { _properties.SetInt(PROPERTYWIDTH, value); }
        }

        public string Embed
        {
            get { return _properties.GetString(PROPERTYEMBED, ""); }
            set { _properties.SetString(PROPERTYEMBED, value); }
        }

        public string Link
        {
            get { return _properties.GetString(PROPERTYLINK, ""); }
            set { _properties.SetString(PROPERTYLINK, value); }
        }

        public int Option
        {
            get { return _properties.GetInt(PROPERTYOPTION, 0); }
            set { _properties.SetInt(PROPERTYOPTION, value); }
        }

        public decimal Ratio
        {
            get { return _properties.GetDecimal(PROPERTYRATIO, 1); }
            set { _properties.SetDecimal(PROPERTYRATIO, value); }
        }

        public string Title
        {
            get { return _properties.GetString(PROPERTYTITLE, ""); }
            set { _properties.SetString(PROPERTYTITLE, value); }
        }

        public bool OpenNew
        {
            get { return _properties.GetBoolean(PROPERTYOPEN, false); }
            set { _properties.SetBoolean(PROPERTYOPEN, value); }
        }

        public bool Transparency
        {
            get { return _properties.GetBoolean(PROPERTYTRANSPARENCY, true); }
            set { _properties.SetBoolean(PROPERTYTRANSPARENCY, value); }
        }

        public bool TitleIsEnabled
        {
            get { return _properties.GetBoolean(PROPERTYTITLEENABLED, false); }
            set { _properties.SetBoolean(PROPERTYTITLEENABLED, value); }
        }

        public bool Autoplay
        {
            get { return _properties.GetBoolean(PROPERTYAUTOPLAY, false); }
            set { _properties.SetBoolean(PROPERTYAUTOPLAY, value); }
        }

        public string AutoPlayValue
        {
            get { return _properties.GetString(PROPERTYAUTOPLAYVALUE, ""); }
            set { _properties.SetString(PROPERTYAUTOPLAYVALUE, value); }
        }

        public bool AllowAutoPlay
        {
            get { return _properties.GetBoolean(PROPERTYALLOWAUTOPLAY, false); }
            set { _properties.SetBoolean(PROPERTYALLOWAUTOPLAY, value); }
        }

        public string FinalEmbedCode
        {
            get { return _properties.GetString(FINALCODE, ""); }
            set { _properties.SetString(FINALCODE, value); }
        }

        public int MarginState
        {
            get { return _properties.GetInt(MARGINSTATE, 0); }
            set { _properties.SetInt(MARGINSTATE, value); }
        }

        #region Margin Properties
        public int Top
        {
            get { return _properties.GetInt(_1, 0); }
            set { _properties.SetDecimal(_1, value); }
        }

        public int Right
        {
            get { return _properties.GetInt(_2, 0); }
            set { _properties.SetDecimal(_2, value); }
        }

        public int Bottom
        {
            get { return _properties.GetInt(_3, 0); }
            set { _properties.SetDecimal(_3, value); }
        }

        public int Left
        {
            get { return _properties.GetInt(_4, 0); }
            set { _properties.SetDecimal(_4, value); }
        }

        public bool YouTubeRelative
        {
            get { return _properties.GetBoolean(YOUTUBEREL, true); }
            set { _properties.SetBoolean(YOUTUBEREL, value); }
        }
        #endregion

    }
}
